package com.hunliji.monitor.manager.api.model.dto.gitlab;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author banxuan
 * Date : 2023/10/19
 * Time : 17:16
 */
@NoArgsConstructor
@Data
public class GitlabDiscussion {
    @JsonProperty("id")
    private String id;
    @JsonProperty("individual_note")
    private Boolean individualNote;
    @JsonProperty("notes")
    private List<NotesDTO> notes;

    @NoArgsConstructor
    @Data
    public static class NotesDTO {
        @JsonProperty("id")
        private Integer id;
        @JsonProperty("type")
        private String type;
        @JsonProperty("body")
        private String body;
        @JsonProperty("attachment")
        private Object attachment;
        @JsonProperty("author")
        private AuthorDTO author;
        @JsonProperty("created_at")
        private String createdAt;
        @JsonProperty("updated_at")
        private String updatedAt;
        @JsonProperty("system")
        private Boolean system;
        @JsonProperty("noteable_id")
        private Integer noteableId;
        @JsonProperty("noteable_type")
        private String noteableType;
        @JsonProperty("commit_id")
        private Object commitId;
        @JsonProperty("resolvable")
        private Boolean resolvable;
        @JsonProperty("resolved")
        private Boolean resolved;
        @JsonProperty("resolved_by")
        private Object resolvedBy;
        @JsonProperty("resolved_at")
        private Object resolvedAt;
        @JsonProperty("confidential")
        private Boolean confidential;
        @JsonProperty("noteable_iid")
        private Integer noteableIid;

        @NoArgsConstructor
        @Data
        public static class AuthorDTO {
            @JsonProperty("id")
            private Integer id;
            @JsonProperty("name")
            private String name;
            @JsonProperty("username")
            private String username;
            @JsonProperty("state")
            private String state;
            @JsonProperty("avatar_url")
            private String avatarUrl;
            @JsonProperty("web_url")
            private String webUrl;
        }
    }
}
